.card-header
  h3.card-title
    = t('teardowns.show.signature_title', count: @metadata.developer_certs.size)
  .card-tools
    button.btn.btn-tool data-lte-toggle="card-collapse"
      i.fa-solid.fa-plus data-lte-icon="expand"
      i.fa-solid.fa-minus data-lte-icon="collapse"
.card-body.certificates
  - signatures.each_with_index do |signature, i|
    .certificate
      .certificate-title
        .fs-6.fw-bolder.flex-fill
          = t('teardowns.show.signature', scheme: "v#{signature['scheme']}")
        small.text-body-secondary.float-end
          - if signature['certificates'].present?
            = t('teardowns.show.signature_unverified')
          - else
            = t('teardowns.show.signature_not_found')

      - if signature['certificates'].present?
        - signature['certificates'].each_with_index do |certificate, i|
          .fs-6.fw-bolder.mt-2 = t('teardowns.show.cert', index: "#{i + 1}")
          ul
            li
              span.key = t('teardowns.show.cert_serial')
              span.value = "#{certificate['serial']['number']} (#{certificate['serial']['hex']})"
            li
              span.key = t('teardowns.show.cert_version')
              span.value = certificate['version']
            li
              span.key = t('teardowns.show.cert_algorithem')
              span.value = certificate['algorithem']
            li
              span.key = t('teardowns.show.cert_digest')
              span.value = certificate['digest']
            - if certificate['length'].present?
              li
                span.key = t('teardowns.show.cert_length')
                span.value = certificate['length']
            li
              span.key = t('teardowns.show.cert_issuer')
              span.value = certificate_name(certificate['issuer'])
            li
              span.key = t('teardowns.show.cert_created')
              span.value = l(Time.zone.parse(certificate['created_at']), format: :nice)
            li
              span.key = t('teardowns.show.cert_expired')
              span.value = t('teardowns.show.cert_expired_at', date: l(Time.zone.parse(certificate['expired_at']), format: :nice))
            li
              span.key = t('teardowns.show.cert_fignger', digest: 'SHA-256')
              span.value = certificate['fingerprint']['sha256']
            li
              span.key = t('teardowns.show.cert_fignger', digest: 'SHA-1')
              span.value = certificate['fingerprint']['sha1']
            li
              span.key = t('teardowns.show.cert_fignger', digest: 'MD5')
              span.value = certificate['fingerprint']['md5']
